import ajax from './ajax.js'
import store from '../store/index.js'
/**
 * @description: 查询监控的股票
 * @author: majun
 */
export function careList() {
  return ajax.get({
    url: `api/care/list/`,
    notoken: !store.state.vuex_token
  })
}

/**
 * @description: 新增监控股票
 * @param {*} params
 * @author: majun
 */
export function careAdd(params) {
  return ajax.post({
    url: `api/care/add`,
    // type: 'formData',
    params
  })
}

/**
 * @description: 取消监控
 * @param {*} data
 * @author: majun
 */
export function careCancel(params) {
  return ajax.put({
    url: `api/care/cancel`,
    params
  })
}

/**
 * @description: 查询是否监控的股票
 * @author: majun
 */
export function careExist(params) {
  return ajax.get({
    url: `api/care/exist`,
    notoken: !store.state.vuex_token,
    params
  })
}

/**
 * @description: 新增监控股票
 * @param {*} params
 * @author: majun
 */
export function subscribeSend(params) {
  return ajax.post({
    url: `api/subscribe/send`,
    params
  })
}
